﻿using System;
namespace WebBuddy.Ajax
{
    public interface IAjax
    {
        /// <summary>
        /// Make an ajax requeset, caring not about failure
        /// </summary>
        void Get<TResponseType>(Uri requestUri, System.Collections.Generic.Dictionary<string, string> parameters, GetResponseCallback<TResponseType> callback, object state);

        /// <summary>
        /// Make an ajax request, with a way to fail
        /// </summary>
        /// <param name="requestUri">Uri to make a request to</param>
        /// <param name="parameters">Your parameters</param>
        /// <param name="options">The options when finished</param>
        /// <param name="failure">Callback for when the request fails</param>
        /// <param name="state">Any state information</param>
        void Get<TResponseType>(Uri requestUri, System.Collections.Generic.Dictionary<string, string> parameters, GetResponseCallback<TResponseType> callback, AjaxFailure failure, object state);

        /// <summary>
        /// Make an ajax requesetwith any kind of options you want
        /// </summary>
        /// <param name="requestUri">Uri to make a request to</param>
        /// <param name="parameters">Your parameters</param>
        /// <param name="options">The options when finished</param>
        void Get<TResponseType>(Uri requestUri, System.Collections.Generic.Dictionary<string, string> parameters, AjaxOptions<TResponseType> options);
    }
}
